/*
  Copyright 2002, Blair Kitchen

  This file is part of MySQL-Tcl.

  MySQL-Tcl is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  MySQL-Tcl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with MySQL-Tcl; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef __MYSQL_TCL_H__
#define __MYSQL_TCL_H__

#include <tcl.h>

//Required in order to build a DLL for use with Tcl.
#ifdef WIN32
#ifdef BUILD_mysql_tcl
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
#endif
#endif

//Define TRUE and FALSE.
#define TRUE 1
#define FALSE 0

struct ConnectionInfo_t
{
  MYSQL* conn;
  MYSQL_RES* result;
};

typedef struct ConnectionInfo_t ConnectionInfo;

EXTERN int Mysql_tcl_Init(Tcl_Interp* interp);

int MySQL_Connect(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_Disconnect(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_SelectDB(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_EscapeString(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_Query(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_NextRow(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_NumRows(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]);
int MySQL_Cleanup(ClientData clientData);

#endif

